<div class="form">

<?php $form=$this->beginWidget('CActiveForm', array(
	'id'=>'product-category-form',
	'enableAjaxValidation'=>false,
	'focus'=>Utils::AutoFocus($model, 'title')
)); ?>
	<?php echo CHtml::hiddenField('action','update'); ?>

	<?php echo $form->errorSummary($model); ?>
<table width="100%">
	<tr><td style="vertical-align:top">
		<table>
			<tr>
				<td class="col1">
					<?php echo 'Danh mục cấp 3:'; ?>
				</td>
				<td class="col2">
					<?php echo $form->dropDownList($model,'parent_id',CHtml::listData(ProductChannel::model()->findAllChannelLevel(2),'id','title'));?>
				</td>
			</tr>

			<tr>
				<td class="col1"><?php echo $form->labelEx($model,'title'); ?></td>
				<td class="col2"><?php echo $form->textField($model,'title',array('size'=>60,'maxlength'=>255)); ?></td>
			</tr>

			<tr>
				<td class="col1"><?php echo $form->labelEx($model,'sort'); ?></td>
				<td class="col2"><?php echo $form->textField($model,'sort',array('size'=>11,'maxlength'=>11)); ?></td>
			</tr>

			<tr>
				<td class="col1"><?php echo $form->labelEx($model,'visible'); ?></td>
				<td class="col2"><?php echo $form->checkbox($model,'visible'); ?></td>
			</tr>

		</table>
	</td>
	<td class="col2" width="35%">
		<fieldset>
			<legend><?php echo Yii::t('backend','Thông tin') ?></legend>
			<?php $this->widget('zii.widgets.CDetailView', array(
				'data'=>$model,
				'attributes'=>array(
					'id',
					array(
						'name'=>$model->level==1?'Danh mục cha':'Danh mục cha cấp 1',
						'value'=>isset($model->parent->title)?$model->parent->title:'',
						'type'=>'raw',
					),
					'level',
					'visible:boolean',
				),
			)); ?>
		</fieldset>
	</td>
</table>
<?php $this->endWidget(); ?>

</div><!-- form -->